var member_id = goods_id = ws = order_id = '';
document.addEventListener('plusready',function(){
	member_id = plus.storage.getItem('id');
	ws = plus.webview.currentWebview();
	goods_id = ws.goodsid;
	store_id = ws.store_id;
	console.log(apiRoot+"?act=goods&op=index&goods_id="+goods_id);
	$.ajax({ 
		type:"get", 
		url:apiRoot+"?act=goods&op=index&goods_id="+goods_id,
		dataType:'json', 
		success:function(data){  
			console.log(JSON.stringify(data));
			if(data){ 
				$('.tel').attr('data-tel',data.goods_info.contacts_phone);
				$('.title').text(data.goods_info.goods_name);
				$('.mui-btn-blue').text(data.goods_info.gc_name.substr(data.goods_info.gc_name.lastIndexOf(';')+1));
				$('.red').text('￥' + data.goods_info.goods_price); 
				$('.pic').attr('src', (pics + data.goods_info.store_id + '/' + data.goods_info.goods_image));			//图片 
				$('.mui-h5').text('销量：'+data.goods_info.goods_salenum);			//销量
				$('.shop').html(data.goods_info.mobile_body);
				$('.evaluate').text('评价('+data.goods_info.evaluation_count+')');
				$('.wid30').attr('data-goods_id',data.goods_info.goods_id);
				
			}else{
				toast('加载失败！');
			}
			
			$('.wid30').on('click',function(){
				var _this = $(this);
				var goods_id = _this.attr('data-goods_id');
				var nwaiting = plus.nativeUI.showWaiting();//显示原生等待框
				var webviewContent= plus.webview.create('./Travel_goods.html','Travel_goods.html',{},{goods_id:goods_id});//后台创建webview并打开show.html
				webviewContent.addEventListener("loaded", function() { //注册新webview的载入完成事件
			        nwaiting.close(); //新webview的载入完毕后关闭等待框
			        webviewContent.show("slide-in-right",500); //把新webview窗体显示出来，显示动画效果为速度200毫秒的右侧移入动画
			    }, false);
			})
			
		}, 
		error:function(e){
			toast('连接失败！');
		}
	});
},false);